<script>
  document.write(history.length)
with(document)
{
  write("line1 <br>")
  write("line2 <br>")
}
  var go_back=confirm("Do you want to go back?")
  if(go_back==true)
    history.back()
</script>
